<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <meta name="author" content="林镭特">
  <title></title>
  <style>
    main{
      border: 1px solid black;
      margin-top: 15px;
      text-align: center;
    }
    section{
      background-color: darkgrey;
    }
  </style>
</head>
<body>
  <h1>贴吧</h1>

  <!-- <div class="login">
    <a href="/loginbtn">登录</a>
    <a href="/registbtn">注册</a>
  </div> -->

  {{if username}}
  <div class="logou">
      <span>{{username}}</span>
      <a href="/logout">退出</a>
  </div>
  {{else}}
  <div class="login">
    <a href="/loginbtn">登录</a>
    <a href="/registbtn">注册</a>
  </div>
  {{/if}}

<form action="/mess" method="get">
  <textarea
    name="txt"
    id=""
    cols="50"
    rows="10"
    placeholder="请输入留言信息"
    
    {{if username}}
    abled
  {{else}}
  disabled
  {{/if}}
  ></textarea
  ><br />
  <button type="submit">提交</button>
</form>


  {{each content}}
<main>
  <div>
    <span>{{$value.time1}}</span>
    <span>{{$value.time2}}</span>
    <span>|</span>
    <span>{{$value.host.username}}：</span>
  </div>
  <p>{{$value.txt}}</p>
  <section>
   
    
{{each $value.reply}}
<span>{{$value.host.username}}：</span><span>{{$value.txt}}</span>
<span>{{$value.time1}}</span><span>{{$value.time2}}</span> <span>回复</span>
<br>
{{/each}}

    <form action="/Replay/{{$value._id.toString()}}" method="get">
      <textarea
        name="txt"
        id=""
        cols="50"
        rows="5"
        placeholder="请输入留言信息"
        {{if username}}
    abled
  {{else}}
  disabled
  {{/if}}
      ></textarea
      ><br />
      <button type="submit">回复</button>
    </form>
  </section>
</main>
  {{/each}}


<script>
  
</script>
</body>
</html>